package com.sky.controller.user;

import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.ClassifyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@Slf4j
@RestController
@Api(tags = "C端用户分类查询接口")
public class CategoryController {
    @Autowired
    private ClassifyService classifyService;

    @GetMapping("/user/category/list")
    @ApiOperation("分类查询")
    public Result<List<Category>> search(Integer type) {
        log.info("C端分类查询类型{}", type);
        List<Category> list;
        list = classifyService.userTypeSearch(type);
        return Result.success(list);
    }
}
